package com.itgacl.magic4j.libcommon.component.delayQueue.service;


import com.itgacl.magic4j.libcommon.component.delayQueue.bean.QueueData;
import com.itgacl.magic4j.libcommon.component.delayQueue.queue.DelayQueue;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * 提交消息
 */
public interface DelayQueueService extends DelayQueue {

    /**
     * 提交消息
     *
     * @param message 消息
     */
    void commit(String message, Date delayTime);

    void commit(String message, LocalDateTime delayTime);


    /**
     * 提交消息
     *
     * @param msgId     消息ID
     * @param message   消息
     * @param delayTime 延迟时间
     */
    void commit(String msgId, String message, Date delayTime);

    void commit(String msgId, String message, LocalDateTime delayTime);

    QueueData getByMsgId(String msgId);

    /**
     * 发送指定消息ID的消息
     * delay time
     */
    void sendMessage(String msgId);

    List<QueueData> getAll();
}
